package com.itheima_07;
/*
    Lambda表达式和匿名内部类的区别
 */
public class LambdaDemo {
    public static void main(String[] args) {
        //匿名内部类
        /*
        useInter(new Inter() {
            @Override
            public void show() {
                System.out.println("接口");
            }
        });

        useAnimal(new Animal() {
            @Override
            public void method() {
                System.out.println("抽象类");
            }
        });

        useStudent(new Student(){
            @Override
            public void study() {
                System.out.println("具体类");
            }
        });
         */

        //Lambda表达式
//        useStudent(()-> System.out.println("具体类"));
//        useAnimal(()-> System.out.println("抽象类"));L
        useInter(()-> System.out.println("接口"));

    }

    private static void useStudent(Student s){
        s.study();
    }

    private static void useAnimal(Animal a){
        a.method();
    }

    private static void useInter(Inter i){
        i.show();
    }
}
